﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using _02.ClassLibrary;
using System.Runtime.Remoting;

namespace _03.应用程序域
{
    class Program
    {
        static void Main(string[] args)
        {
            AppDomain domain=AppDomain.CreateDomain("TestDomain");
            Console.WriteLine(domain.FriendlyName);
            //下面两句话不对
            //ObjectHandle handle = domain.CreateInstance("02.ClassLibrary", "_02.ClassLibrary.TestClass");
            //object.object t = handle.Unwrap();
            //将02.创建程序集的例子嫁接进来
            domain.ExecuteAssembly(@"D:\Desktop\Getbooks\01 C#高级编程_第七版\18.程序集\02.创建程序集\bin\Debug\02.创建程序集.exe");
            
            AppDomain.Unload(domain);
            Console.ReadKey();
        }
    }
}
